<?php
use \yii\helpers\Html;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ECSHOP 管理中心 - 添加新商品 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="<?= __CSS__ ?>/general.css" rel="stylesheet" type="text/css"/>
    <link href="<?= __CSS__ ?>/main.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1>
    <span class="action-span"><a href="__GROUP__/Goods/goodsList">商品列表</a>
    </span>
    <span class="action-span1"><a href="__GROUP__">ECSHOP 管理中心</a></span>
    <span id="search_id" class="action-span1"> - 添加新商品 </span>
    <div style="clear:both"></div>
</h1>

<div class="tab-div">
    <div id="tabbar-div">
        <p>
            <span class="tab-front" id="general-tab">通用信息</span>
        </p>
    </div>
    <div id="tabbody-div">
        <?= Html::beginForm('', 'post', ['enctype' => 'multipart/form-data']) ?>
        <table width="90%" id="general-table" align="center">
            <tr>
                <td class="label">商品名称：</td>
                <td>
                    <?= Html::activeInput('text', $goods, 'name', ['size' => "30"]) ?>
                    <span class="require-field">*</span>
                </td>
            </tr>
            <tr>
                <td class="label">商品货号：</td>
                <td>
                    <?= Html::activeInput('text', $goods, 'sn', ['size' => "20"]) ?>
                    <span id="goods_sn_notice"></span><br/>
                    <span class="notice-span" id="noticeGoodsSN">如果您不输入商品货号，系统将自动生成一个唯一的货号。</span>
                </td>
            </tr>
            <!--            <tr>
                            <td class="label">商品分类：</td>
                            <td>
                                <select name="cat_id">
                                    <option value="0">请选择...</option>
                                    <foreach name="cat_list" item="val">
                                        <option value="<{$val.cat_id}>">
                                            <{$val.lev|str_repeat='&nbsp;&nbsp;',###}><{$val.cat_name}>
                                        </option>
                                    </foreach>
                                </select>
                                <span class="require-field">*</span>
                            </td>
                        </tr>-->
            <!--            <tr>
                            <td class="label">商品品牌：</td>
                            <td>
                                <select name="brand_id">
                                    <option value="0">请选择...</option>
                                    <foreach name="brand_list" item="val">
                                        <option value="<{$val.brand_id}>"><{$val.brand_name}></option>
                                    </foreach>
                                </select>
                            </td>
                        </tr>-->
            <tr>
                <td class="label">本店售价：</td>
                <td>
                    <?= Html::activeInput('text', $goods, 'sn', ['value' => "0", 'size' => "20"]) ?>
                    <span class="require-field">*</span>
                </td>
            </tr>
            <tr>
                <td class="label">商品数量：</td>
                <td>
                    <?= Html::activeInput('text', $goods, 'stock', ['size' => "8"]) ?>
                </td>
            </tr>
            <tr>
                <td class="label">是否上架：</td>
                <td>
                    <?= Html::activeRadioList($goods, 'is_on_sale', [1 => '是', 0 => '否']) ?>
                </td>
            </tr>
            <tr>
                <td class="label">加入推荐：</td>
                <td>
                    <?= Html::activeCheckboxList($goods, 'goods_status', [1 => '精品', 2 => '新品', 4 => '热销']) ?>
                </td>
            </tr>
            <tr>
                <td class="label">推荐排序：</td>
                <td>
                    <?= Html::activeInput('text', $goods, 'sort', ['value' => "50", 'size' => "5"]) ?>
                </td>
            </tr>
            <tr>
                <td class="label">市场售价：</td>
                <td>
                    <?= Html::activeInput('text', $goods, 'market_price', ['value' => "0", 'size' => "20"]) ?>
                </td>
            </tr>
            <!--            <tr>
                            <td class="label">商品关键词：</td>
                            <td>
                                <input type="text" name="keywords" value="" size="40"/> 用空格分隔
                            </td>
                        </tr>-->
            <!--            <tr>
                            <td class="label">商品图片：</td>
                            <td>
                                <input type="file" name="goods_img" size="35"/>
                            </td>
                        </tr>-->
            <tr>
                <td class="label">商品简单描述：</td>
                <td>
                    <!-- 加载编辑器的容器 -->
                    <textarea id="container" name="goods_intro"></textarea>
                </td>
            </tr>

        </table>
        <div class="button-div">
            <?= Html::activeHiddenInput($goods, 'id') ?>
            <td><?= Html::submitButton(' 确定 ', ['class' => 'button']) ?></td>
            <td><?= Html::resetButton(' 重置 ', ['class' => 'button']) ?></td>
        </div>
        <?= Html::endForm() ?>
    </div>
</div>

<div id="footer">
    共执行 9 个查询，用时 0.025161 秒，Gzip 已禁用，内存占用 3.258 MB<br/>
    版权所有 &copy; 2005-2012 上海商派网络科技有限公司，并保留所有权利。
</div>
<!-- 配置文件 -->
<script type="text/javascript" src="<?= __UEDITOR__ ?>/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="<?= __UEDITOR__ ?>/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container',{
        initialFrameWidth:600
    });
</script>
</body>
</html>